/*
  M404SD01BA_example.ino
  Written by Jeff Eaton - jeffeats@gmail.com, 2014
  
  This library is used to interface with the Futaba M404SD01BA Vacuum Fluorescent Display
  datasheet -> http://www.jm.pl/karty/M404SD01BA.pdf
  
  This example makes "hello world" appear at random places with a random dimness level
*/

#include "M404SD01BA.h"
#include "SendOnlySoftwareSerial.h"

int txPin = 5;
int busyPin = 6;
long baudRate = 9600;

M404SD01BA lcd = M404SD01BA(txPin, busyPin, baudRate);

int row;
int col;

void setup() {
  randomSeed(analogRead(0)); // seed the random number generator
}

void loop() {
  lcd.clear(); // clear the screen
  row = random(0,4); // 0 through 3
  col = random(0,30); // 0 through 29
  lcd.position(row, col); // change the write position
  lcd.dim(random(0,5)); // set the brightness level at random to one of the four available
  lcd.print("hello world");
  delay(2000); // wait two seconds
}
